#include "Parser.h"
 
Parser::Parser( Data &D, Data &E)
{ 
	while(!D.Test_EOF()) //lecture des caratere jusqu'a End Of File	
	{
		char* c=Trad(D.Get_char());//renvoie caractere
		
		E.Write(c);
	}

}

Parser::~Parser()
{
}

string Parser::Trad(string c)
{
	string test;
	switch(c){
		case "<":
			test="GO_LEFT";
			break;
		case ">":
			test="GO_RIGHT";
			break;
		case "+":
			test="ADD";
			break;
		case "-":
			test="SUB";
			break;
		case "[":
			test="BEGIN_LOOP";
			break;
		case "]":
			test="END_LOOP";
			break;
		default:
			cout << "unknown character!";
		}
}
